Decouple gamma scheduling from AGD via GammaScheduler#71
Open
sanjanag wants to merge 2 commits intolinkedin:masterfrom
Open
Decouple gamma scheduling from AGD via GammaScheduler#71sanjanag wants to merge 2 commits intolinkedin:masterfrom
sanjanag wants to merge 2 commits intolinkedin:masterfrom
Conversation
Move gamma decay out of AcceleratedGradientDescent into a standalone GammaScheduler that drives the objective via set_gamma() and is wired into the optimizer through a new step_callback hook on maximize(). The optimizer no longer owns gamma; objectives store and update their own. Add an 'interval' schedule alongside the existing 'step' decay. Extract the small calc_grad helper into utils/objective_utils so it can be shared across matching variants without an objectives -> objectives import. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Gamma decay used to live inside
AcceleratedGradientDescent, which madeadding new schedules require touching the optimizer and made it hard for
the optimizer to stay agnostic about objective regularization. This PR
moves the policy out:
GammaSchedulerowns the schedule (stepandintervalbuilt in,trivially extensible) and drives the objective via
set_gamma().AGD.maximize()gets astep_callbackhook; the scheduler plugs in there.MIPLIB2017ObjectiveFunctionacceptsgammain__init__; both matching objectives gainset_gamma().BaseObjective.set_gammais a no-op default so objectives without aregularization parameter keep working unchanged.
run_solverconstructs aGammaSchedulerautomatically whensolver_args.gamma_decay_typeis set.calc_gradintoutils/objective_utilsso thematching variants share it without an objectives→objectives import.
API change
AcceleratedGradientDescent.__init__no longer takesgamma,gamma_decay_type, orgamma_decay_params. Passgammato the objectiveconstructor instead, and use
GammaScheduler+step_callbackfor decay.MIPLIB2017ObjectiveFunction.calculateno longer takesgammaper call;update gamma via
set_gamma().Test plan
tests/test_gamma_scheduler.py(12 cases): step + intervalschedules, AGD integration via
step_callback, parametervalidation, no-decay case, gamma-increase warning
(
pytest tests/ --ignore=tests/distributed: 58 passed, 2 skipped)